import os
from time import sleep
from selenium.webdriver.common.by import By
from selenium import webdriver

driver = webdriver.Chrome()
url = 'file:///' + os.path.abspath('html') + '/upload_file.html'
driver.get(url)
sleep(1)

# 定位上传按钮位置,并传入绝对路径
file1 = os.path.abspath('html') + '/radio-checkbox.html'
driver.find_element(By.NAME, 'file').send_keys(file1)

sleep(3)
driver.quit()
